<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>dil.Converter</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "dil.Converter";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/dil.Converter.html" class="symbol">dil.Converter</a></h1>
  
<p class="sec_header">Author:</p>Aziz Köksal
<p class="sec_header">License:</p>GPL3
 <p><b>Maturity:</b> very high.</p>
<dl>
<dt class="decl">struct <a class="symbol _struct" name="Converter" href="./htmlsrc/dil.Converter.html#L15" kind="struct" beg="15" end="246">Converter</a>; <a title="Permalink to this symbol" href="#Converter" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Converter.html#L15">#</a></dt>
<dd class="ddef">
<div class="summary">Converts various Unicode encoding formats to UTF-8.</div>
<dl>
<dt class="decl">char[] <a class="symbol _variable" name="Converter.filePath" href="./htmlsrc/dil.Converter.html#L17" kind="variable" beg="17" end="17">filePath</a>; <a title="Permalink to this symbol" href="#Converter.filePath" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Converter.html#L17">#</a></dt>
<dd class="ddef">
<div class="summary">For error messages.</div></dd>
<dt class="decl">Diagnostics <a class="symbol _variable" name="Converter.diag" href="./htmlsrc/dil.Converter.html#L18" kind="variable" beg="18" end="18">diag</a>; <a title="Permalink to this symbol" href="#Converter.diag" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Converter.html#L18">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">Converter <a class="symbol _function" name="Converter.opCall" href="./htmlsrc/dil.Converter.html#L20" kind="function" beg="20" end="26">opCall</a><span class="params">(char[] <em>filePath</em>, Diagnostics <em>diag</em>)</span>; <span class="attrs">[<span class="stc">static</span>]</span> <a title="Permalink to this symbol" href="#Converter.opCall" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Converter.html#L20">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">dchar <a class="symbol _function" name="Converter.swapBytes" href="./htmlsrc/dil.Converter.html#L29" kind="function" beg="29" end="35">swapBytes</a><span class="params">(dchar <em>c</em>)</span>; <a title="Permalink to this symbol" href="#Converter.swapBytes" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Converter.html#L29">#</a></dt>
<dd class="ddef">
<div class="summary">Byte-swaps c.</div></dd>
<dt class="decl">wchar <a class="symbol _function" name="Converter.swapBytes:2" href="./htmlsrc/dil.Converter.html#L38" kind="function" beg="38" end="41">swapBytes</a><span class="params">(wchar <em>c</em>)</span>; <a title="Permalink to this symbol" href="#Converter.swapBytes:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Converter.html#L38">#</a></dt>
<dd class="ddef">
<div class="summary">Byte-swaps c.</div></dd>
<dt class="decl">dchar <a class="symbol _function" name="Converter.BEtoMachineDword" href="./htmlsrc/dil.Converter.html#L44" kind="function" beg="44" end="50">BEtoMachineDword</a><span class="params">(dchar <em>c</em>)</span>; <a title="Permalink to this symbol" href="#Converter.BEtoMachineDword" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Converter.html#L44">#</a></dt>
<dd class="ddef">
<div class="summary">Swaps the bytes of c on a little-endian machine.</div></dd>
<dt class="decl">dchar <a class="symbol _function" name="Converter.LEtoMachineDword" href="./htmlsrc/dil.Converter.html#L53" kind="function" beg="53" end="59">LEtoMachineDword</a><span class="params">(dchar <em>c</em>)</span>; <a title="Permalink to this symbol" href="#Converter.LEtoMachineDword" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Converter.html#L53">#</a></dt>
<dd class="ddef">
<div class="summary">Swaps the bytes of c on a big-endian machine.</div></dd>
<dt class="decl">wchar <a class="symbol _function" name="Converter.BEtoMachineWord" href="./htmlsrc/dil.Converter.html#L62" kind="function" beg="62" end="68">BEtoMachineWord</a><span class="params">(wchar <em>c</em>)</span>; <a title="Permalink to this symbol" href="#Converter.BEtoMachineWord" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Converter.html#L62">#</a></dt>
<dd class="ddef">
<div class="summary">Swaps the bytes of c on a little-endian machine.</div></dd>
<dt class="decl">wchar <a class="symbol _function" name="Converter.LEtoMachineWord" href="./htmlsrc/dil.Converter.html#L71" kind="function" beg="71" end="77">LEtoMachineWord</a><span class="params">(wchar <em>c</em>)</span>; <a title="Permalink to this symbol" href="#Converter.LEtoMachineWord" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Converter.html#L71">#</a></dt>
<dd class="ddef">
<div class="summary">Swaps the bytes of c on a big-endian machine.</div></dd>
<dt class="decl">char[] <a class="symbol _function" name="Converter.UTF32toUTF8" href="./htmlsrc/dil.Converter.html#L80" kind="function" beg="80" end="116">UTF32toUTF8</a><span class="tparams">(bool isBigEndian)</span><span class="params">(ubyte[] <em>data</em>)</span>; <a title="Permalink to this symbol" href="#Converter.UTF32toUTF8" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Converter.html#L80">#</a></dt>
<dd class="ddef">
<div class="summary">Converts a UTF-32 text to UTF-8.</div></dd>
<dt class="decl">alias UTF32toUTF8!(true) <a class="symbol _alias" name="Converter.UTF32BEtoUTF8" href="./htmlsrc/dil.Converter.html#L118" kind="alias" beg="118" end="118">UTF32BEtoUTF8</a>; <a title="Permalink to this symbol" href="#Converter.UTF32BEtoUTF8" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Converter.html#L118">#</a></dt>
<dd class="ddef">
<div class="summary">Instantiation for UTF-32 BE.</div></dd>
<dt class="decl">alias UTF32toUTF8!(false) <a class="symbol _alias" name="Converter.UTF32LEtoUTF8" href="./htmlsrc/dil.Converter.html#L119" kind="alias" beg="119" end="119">UTF32LEtoUTF8</a>; <a title="Permalink to this symbol" href="#Converter.UTF32LEtoUTF8" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Converter.html#L119">#</a></dt>
<dd class="ddef">
<div class="summary">Instantiation for UTF-32 LE.</div></dd>
<dt class="decl">char[] <a class="symbol _function" name="Converter.UTF16toUTF8" href="./htmlsrc/dil.Converter.html#L122" kind="function" beg="122" end="178">UTF16toUTF8</a><span class="tparams">(bool isBigEndian)</span><span class="params">(ubyte[] <em>data</em>)</span>; <a title="Permalink to this symbol" href="#Converter.UTF16toUTF8" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Converter.html#L122">#</a></dt>
<dd class="ddef">
<div class="summary">Converts a UTF-16 text to UTF-8.</div></dd>
<dt class="decl">alias UTF16toUTF8!(true) <a class="symbol _alias" name="Converter.UTF16BEtoUTF8" href="./htmlsrc/dil.Converter.html#L180" kind="alias" beg="180" end="180">UTF16BEtoUTF8</a>; <a title="Permalink to this symbol" href="#Converter.UTF16BEtoUTF8" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Converter.html#L180">#</a></dt>
<dd class="ddef">
<div class="summary">Instantiation for UTF-16 BE.</div></dd>
<dt class="decl">alias UTF16toUTF8!(false) <a class="symbol _alias" name="Converter.UTF16LEtoUTF8" href="./htmlsrc/dil.Converter.html#L181" kind="alias" beg="181" end="181">UTF16LEtoUTF8</a>; <a title="Permalink to this symbol" href="#Converter.UTF16LEtoUTF8" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Converter.html#L181">#</a></dt>
<dd class="ddef">
<div class="summary">Instantiation for UTF-16 LE.</div></dd>
<dt class="decl">char[] <a class="symbol _function" name="Converter.data2UTF8" href="./htmlsrc/dil.Converter.html#L185" kind="function" beg="185" end="245">data2UTF8</a><span class="params">(ubyte[] <em>data</em>)</span>; <a title="Permalink to this symbol" href="#Converter.data2UTF8" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Converter.html#L185">#</a></dt>
<dd class="ddef">
<div class="summary">Converts the text in data to UTF-8.
 Leaves data unchanged if it is in UTF-8 already.</div></dd></dl></dd>
<dt class="decl">char[] <a class="symbol _function" name="sanitizeText" href="./htmlsrc/dil.Converter.html#L250" kind="function" beg="250" end="305">sanitizeText</a><span class="params">(char[] <em>text</em>)</span>; <a title="Permalink to this symbol" href="#sanitizeText" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Converter.html#L250">#</a></dt>
<dd class="ddef">
<div class="summary">Replaces invalid UTF-8 sequences with U+FFFD (if there's enough space,)
 and Newlines with '\n'.</div></dd>
<dt class="decl"><a class="symbol _unittest" name="unittest" href="./htmlsrc/dil.Converter.html#L307" kind="unittest" beg="307" end="334">unittest</a>; <a title="Permalink to this symbol" href="#unittest" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Converter.html#L307">#</a></dt>
<dd class="ddef"></dd></dl>
</div>
<div id="footer">
  <p>Copyright © 2007-2008, Aziz Köksal. All rights reserved.</p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Fri Dec 26 04:12:54 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>